<?php

// Functions on the top.

function searchdata()

	{	

	// Collect the information from the $_POST statements. 
	
	
	
	// Submit the information to the MySQL database. 
	
	
	
	// Take responded information.
	
	
	
	// Prepare the data to be returned.
	
	
	
	// Give back the data to the flash app. 



	}



function postdata()

	{
	
	
	// Collect the information from the $_POST statements. 
	
	
	
	// Submit the information to the MySQL database. 
	
	
	
	// Take responded information.
	
	
	
	// Prepare the data to be returned.
	
	
	
	// Give back the data to the flash app. 

	
	}
	

function login($username,$password)

		{
		
			$logininfo = mysql_query($loginrequest) or die ("Unable to request the data from the database." . mysql_error());
			
			while($row = mysql_fetch_row($logininfo))
	
				{
					$userid = $row[0];
					$username = $row[1];
					$password_test = $row[2];
					$name  = $row[3];
					$email  = $row[4];
					$ip = $row[5];
					$admin  = $row[6];
				}
			
			$password = md5($password);
		
			
			if ($password != $password_test )
		
				{
					
					return 0;
				}
			
			else 
		
				{
					return 1;		
				}
	
		}


include_once "open.php";

$searchrequest = ""; // This is the MySQL statement used to request the information from the database.
$postdata = ""; // This is the MySQL statment used to post the data to the database. 
$information = array();

// Collect the information from the POST command. Put it in to an array based on the number. 

$flag = $_POST['flag'];

if ($flag == 1) // This is for the flag of a search for a character by name.

	{
	
		$searchdata = searchdata();
		
		$searchdata = http_build_query($searchdata);
		
		echo $searchdata;
		
		exit();
	}
	
elseif ($flag == 2) // Search by tag

	{
		
	}
	
elseif ($flag == 3) // Search by author name. 

	{
		
	
	}
	
elseif ($flag == 4) // Request for login. 

	{
	
	$user = $_POST['username'];
	$pass = $_POST['password'];
	
	
		login($user,$pass);

	}



?>
